﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Inter.MianShi.Webfrom.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <script src="js/jquery-1.7.2.min.js"></script>
    <title></title>
    <link href="Css/styles.css" rel="stylesheet" />
    <script>
        $(function () {
            $("#login-button").click(function () {

                var name = $("#name").val();
                var pwd = $("#pwd").val();
              
                $.ajax({
                    url: "/Hander/HandlerLogin.ashx",
                    type: "get",
                    data: {
                        name: name,
                        pwd: pwd
                    },
                    success: function (data) {
                     
                        if (data > 0) {
                            alert('登陆成功');
                            location.href = 'Index.aspx';
                        }
                        else {
                         
                            alert('登陆失败')
                        }
                    }
                });
            });
        });
        //function Login() {
        //    var name = $("#name").val();
        //    var pwd = $("#pwd").val();
        //    $.ajax({
        //        url: "/Hander/Handler1.ashx/ProcessRequest",
        //        type: "post",
        //        data: {
        //            name: name,
        //            pwd:pwd
        //        },
        //        success: function (data) {
        //            if(data>0)
        //            {
        //                alert('登陆成功')
        //                location.href = 'Index.aspx';
        //            }
        //            else
        //            {
        //                alert('登陆失败')
        //            }
        //        }
        //    })
        //}
    </script>
</head>
<body>
    <div class="wrapper">

	<div class="container">
		<h1>MOOC 后台管理</h1>
		<form class="form">
			<input type="text" placeholder="Username" id="name"/>
			<input type="password" placeholder="Password" id="pwd"/><br/>
			<button type="submit" id="login-button"><strong>登陆</strong></button>
			
		</form>
	</div>
	
	<ul class="bg-bubbles">
		<li></li>
		<li></li>
		
	</ul>
</div>
</body>
</html>
